<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../build/react/umd/react.development.js"></script>
    <script src="../build/react-dom/umd/react-dom.development.js"></script>
    <script src="../build/babel/babel.min.js"></script>
    <script src="../build/prop-types/prop-types.js"></script>
</head>

<body>
    <p>F12打开控制台看错误信息</p>
    <div id="root"></div>
    <script type="text/babel">
    var data = 123;
    var data2 = "sand box";

    class NewTitle extends React.Component {
        static propTypes = {
            title: PropTypes.string.isRequired,
        }
        render() {
            return <h1> {this.props.title} </h1>;
        }
    }

    ReactDOM.render(
    <div>
        <div><NewTitle title={data} /></div>
        <div><NewTitle title={data2} /></div>
    </div>,
    document.getElementById('root')
    );
    </script>
</body>

</html>